package com.meiqiongproperty.yiguanjia.db.table;

import com.meiqiongproperty.yiguanjia.httpbean.UserInfo;

/**
 * @version V1.0
 * @packge com.meiqiongproperty.yiguanjia.db.table
 * @User ChenJing
 * @Date 2017/5/22
 */

public interface DefaultHouseTable {
    public static final String TABLE_NAME = "house_info";

    public static final String _ID = "_id";
    public static final String COMMUNITYID = "communityid";
    public static final String PROVINCE = "province";
    public static final String CITY = "city";
    public static final String AREA = "area";
    public static final String COMMUNITYNAME = "communityname";
    public static final String BUILD = "build";
    public static final String ROOM = "room";
    public static final String ROOMAREA = "roomarea";
    public static final String ROOMPRICE = "roomprice";
    public static final String COMMUNITYADDRESS = "communityaddress";
    public static final String BUTLERID = "butlerid";
    public static final String BUTLERNAME = "butlername";
    public static final String BUTLERPHONE = "butlerphone";
    public static final String PROPERTYNAME = "propertyname";
    public static final String PROPERTYID = "propertyid";
    public static final String PROPERTYPHONE = "propertyphone";
    public static final String DEFAULTS = "defaults";
    public static final String AUDIT = "audit";
    public static final String ID = "id";


    // 字段的索引号
    public static final int INDEX__ID = 0;
    public static final int INDEX_COMMUNITYID = 1;
    public static final int INDEX_PROVINCE = 2;
    public static final int INDEX_CITY = 3;
    public static final int INDEX_AREA = 4;
    public static final int INDEX_COMMUNITYNAME = 5;
    public static final int INDEX_BUILD = 6;
    public static final int INDEX_ROOM = 7;
    public static final int INDEX_ROOMAREA = 8;
    public static final int INDEX_ROOMPRICE = 9;
    public static final int INDEX_COMMUNITYADDRESS = 10;
    public static final int INDEX_BUTLERID = 11;
    public static final int INDEX_BUTLERNAME = 12;
    public static final int INDEX_BUTLERPHONE = 13;
    public static final int INDEX_PROPERTYNAME = 14;
    public static final int INDEX_PROPERTYID = 15;
    public static final int INDEX_PROPERTYPHONE = 16;
    public static final int INDEX_DEFAULT = 17;
    public static final int INDEX_AUDIT = 18;
    public static final int INDEX_ID=19;

    /**
     * SQL,删除表
     */
    public static final String SQL_TABLE_DROP = String.format(
            "DROP TABLE IF EXISTS %s;", TABLE_NAME);
    //创建表语句
    public static final String SQL_TABLE_CREATE = new StringBuilder()
            .append("CREATE TABLE IF NOT EXISTS ").append(TABLE_NAME)
            .append("(").append(_ID).append(" INTEGER PRIMARY KEY,")
            .append(COMMUNITYID).append(" TEXT,")
            .append(PROVINCE).append(" TEXT,")
            .append(CITY).append(" TEXT,")
            .append(AREA).append(" TEXT,")
            .append(COMMUNITYNAME).append(" TEXT,")
            .append(BUILD).append(" TEXT,")
            .append(ROOM).append(" TEXT,")
            .append(ROOMAREA).append(" TEXT,")
            .append(ROOMPRICE).append(" TEXT,")
            .append(COMMUNITYADDRESS).append(" TEXT,")
            .append(BUTLERID).append(" TEXT,")
            .append(BUTLERNAME).append(" TEXT,")
            .append(BUTLERPHONE).append(" TEXT,")
            .append(PROPERTYNAME).append(" TEXT,")
            .append(PROPERTYID).append(" TEXT,")
            .append(PROPERTYPHONE).append(" TEXT,")
            .append(DEFAULTS).append(" TEXT,")
            .append(AUDIT).append(" TEXT,")
            .append(ID).append(" TEXT").append(");").toString();
}
